/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.hamacekj.geometr;

import java.awt.Container;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.GraphicsConfiguration;
import java.awt.Window;
import javax.swing.JDialog;
import javax.swing.JEditorPane;
import javax.swing.text.Document;

/**
 * Dialog pro zobrazení nápovědy.
 * @author hamacekh
 */
public class HelpDialog extends JDialog {

    public HelpDialog() {
    }

    public HelpDialog(Dialog owner) {
        super(owner);
    }

    public HelpDialog(Frame owner) {
        super(owner);
    }

    public HelpDialog(Window owner) {
        super(owner);
    }

    public HelpDialog(Dialog owner, String title) {
        super(owner, title);
    }

    public HelpDialog(Dialog owner, boolean modal) {
        super(owner, modal);
    }

    public HelpDialog(Frame owner, String title) {
        super(owner, title);
    }

    public HelpDialog(Frame owner, boolean modal) {
        super(owner, modal);
    }

    public HelpDialog(Window owner, ModalityType modalityType) {
        super(owner, modalityType);
    }

    public HelpDialog(Window owner, String title) {
        super(owner, title);
    }

    public HelpDialog(Dialog owner, String title, boolean modal) {
        super(owner, title, modal);
    }

    public HelpDialog(Frame owner, String title, boolean modal) {
        super(owner, title, modal);
    }

    public HelpDialog(Window owner, String title, ModalityType modalityType) {
        super(owner, title, modalityType);
    }

    public HelpDialog(Dialog owner, String title, boolean modal, GraphicsConfiguration gc) {
        super(owner, title, modal, gc);
    }

    public HelpDialog(Frame owner, String title, boolean modal, GraphicsConfiguration gc) {
        super(owner, title, modal, gc);
    }

    public HelpDialog(Window owner, String title, ModalityType modalityType, GraphicsConfiguration gc) {
        super(owner, title, modalityType, gc);
    }

    
    
    private JEditorPane editor;

    @Override
    protected void dialogInit() {
        super.dialogInit(); //To change body of generated methods, choose Tools | Templates.
        Container pane = this.getContentPane();
        editor = new JEditorPane();
        editor.setContentType("text/html");
        editor.setEditable(false);
        pane.add(editor);
        pane.setPreferredSize(new Dimension(600, 500));
        this.pack();
    }
    
    /**
     * Nastaví html text, který bude zobrazovaný tímto dialogem.
     * @param text text ve formátu html.
     */
    public void setText(String text){
        editor.setText(text);
    }
    
    
}
